import request from '@/utils/http'
import { BaseResult, PaginationResult } from '@/types/axios'

export class ContentService {
  // 获取内容列表
  static getListContent(params: any) {
    return request.get<BaseResult<PaginationResult<any>>>({
      url: '/list_content',
      params
    })
  }
  // 修改内容
  static updateContent(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/update_content',
      data
    })
  }
  // 添加内容
  static addContent(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/add_content',
      data
    })
  }
  // 删除内容
  static deleteContent(id: number | string) {
    return request.post<BaseResult>({
      url: '/delete_content',
      data: { id }
    })
  }
  // 获取内容详情
  static getContentDetail(id: number | string) {
    return request.get<BaseResult>({
      url: '/get_content',
      params: { id }
    })
  }
}
